'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, io } = app;

  // 用户表
  router.post('/blog/usercreat', controller.userlist.usercreat);
  router.post('/blog/userupdate', controller.userlist.userupdate);
  router.post('/blog/userdestroy', controller.userlist.userdestroy);
  router.post('/blog/userfindall', controller.userlist.userfind);
  router.post('/blog/login', controller.userlist.userlogin);
  router.post('/blog/useradtime', controller.userlist.useradtime);

  // 关注表
  router.post('/blog/followcreat', controller.followlist.followadd);
  router.post('/blog/followfind', controller.followlist.followfind);
  router.post('/blog/unfollow', controller.followlist.unfollow);

  // 作品表
  router.post('/blog/releasecreat', controller.releaselist.releasecreat);
  router.post('/blog/releaseupdate', controller.releaselist.releaseupdate);
  router.post('/blog/releasefind', controller.releaselist.releasefind);
  router.post('/blog/releasevague', controller.releaselist.releasevague);
  router.post('/blog/releasedelete', controller.releaselist.releasedelete);
  router.post('/blog/releaselike', controller.releaselist.releaselike);


  // 图片表
  router.post('/blog/picupload', controller.piccturelist.uploadoss);
  router.post('/blog/picturecreat', controller.piccturelist.picturecreat);
  router.post('/blog/pictureupdate', controller.piccturelist.pictureupdate);

  router.post('/blog/admincreat', controller.adminlist.admincreat);
  router.post('/blog/adminfind', controller.adminlist.adminfind);
  router.post('/blog/admindestory', controller.adminlist.admindestory);
  router.post('/blog/adminlogin', controller.adminlist.adminlogin);

  router.post('/blog/carousecreat', controller.carouselist.carousecreat);
  router.post('/blog/carousefind', controller.carouselist.carousefind);
  router.post('/blog/carousedestory', controller.carouselist.carousedestory);


  router.post('/blog/commentcreat', controller.commentlist.commentcreat);
  router.post('/blog/commentfind', controller.commentlist.commentfind);
  router.post('/blog/commentdelete', controller.commentlist.commentdelete);

  router.post('/blog/tutorialcreate', controller.tutoriallist.tutorialcreate);
  router.post('/blog/tutorialfind', controller.tutoriallist.tutorialfind);
  router.post('/blog/tutorialdelete', controller.tutoriallist.tutorialdelete);
  router.post('/blog/tutorialupdate', controller.tutoriallist.tutorialupdate);
  router.post('/blog/tutorialike', controller.tutoriallist.tutorialike);


  router.post('/blog/thumbscreate', controller.thumbslist.thumbscreate);
  router.post('/blog/thumbsdelete', controller.thumbslist.thumbsdelete);
  router.post('/blog/thumbsfind', controller.thumbslist.thumbsfind);
  router.post('/blog/thumbslength', controller.thumbslist.thumbslength);


  router.post('/blog/collcetioncreate', controller.collectionlist.collcetioncreate);
  router.post('/blog/collcetiondelete', controller.collectionlist.collcetiondelete);
  router.post('/blog/collcetionfind', controller.collectionlist.collcetionfind);


  router.post('/blog/fieldcreate', controller.fieldlist.fieldcreate);
  router.post('/blog/fieldupdate', controller.fieldlist.fieldupdate);
  router.post('/blog/fieldfind', controller.fieldlist.fieldfind);
  router.post('/blog/fielddelete', controller.fieldlist.fielddelete);
  router.post('/blog/fieldlike', controller.fieldlist.fieldlike);

  router.post('/blog/noticecreat', controller.noticelist.noticecreat);
  router.post('/blog/noticefind', controller.noticelist.noticefind);
  router.post('/blog/noticedestory', controller.noticelist.noticedestory);


  router.post('/blog/appointcreate', controller.appointmentlist.appointcreate);
  router.post('/blog/appointupdate', controller.appointmentlist.appointupdate);
  router.post('/blog/appointdelete', controller.appointmentlist.appointdelete);
  router.post('/blog/appointfind', controller.appointmentlist.appointfind);
  router.post('/blog/appointlike', controller.appointmentlist.appointlike);

  router.post('/blog/sendsms', controller.nodemsg.sendsms);
  router.post('/blog/isregister', controller.nodemsg.isregister);


  router.post('/blog/socketfind', controller.socketlist.socketfind);

  router.post('/blog/findalllength', controller.echartslist.findalllength);


  io.of('/').route('vuelogin', io.controller.chat.vuelogin);
  io.of('/').route('vsendmeg', io.controller.chat.vsendmeg);

};
